<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:v="http://shale.apache.org/validator">

<f:view>
<f:loadBundle var="text" basename="#{reviewTest.bundleName}"/>
<head>
    <title>#{text['review.test.heading']}</title>
    <meta name="menu" content="UserMenu"/>
    <meta name="heading" content="#{reviewTest.currentSectionDescription}"/>
    <style type="text/css">
    	.question-pic {text-align:left; align:left;float=left}
  		.question {text-align:left; background=red;font-size=32}
  	</style>
</head>
<div class="tests_background">
<h:form id="reviewTest" partialTriggers="nextBtn prevBtn">
<h:panelGroup>
    	<h:commandButton value="Previous" id="prevBtn1" action="#{reviewTest.prev}" styleClass="button_small"  partialSubmit="true" rendered="#{reviewTest.previous}"/>
    	<h:commandButton value="Show Result" action="#{userTest.inlineReport}" styleClass="button_small" partialSubmit="true">
	    	<f:param name="testInstanceObjectId" value="#{reviewTest.testInstance.objectId}"/>
	        <!--f:param name="reviewMode" value="result1"/-->
	</h:commandButton>
	<h:commandButton value="Done" action="#{reviewTest.done}" styleClass="button_small"  partialSubmit="true"/>
        <h:commandButton value="Next" id="nextBtn1" action="#{reviewTest.next}" styleClass="button_small"  partialSubmit="true" rendered="#{reviewTest.next}"/>
    </h:panelGroup>
<h:panelGrid >
    <!-- List view -->
	<h:dataTable rendered="#{!reviewTest.table}" 
		style="margin-top: 10px; width: 932px;" cellspacing="4" cellpadding ="10"
		value="#{reviewTest.currentAnswerItems}" var="item" rows="25" 
		styleclass="mainTable"
		headerClass="standardTable_Header" 
		rowClasses="rowA, rowB" >
			<t:column>
				<h:panelGroup>
					<!--h:outputText value="list (1)" /-->
					<h:outputText value="#{item.description}" escape="false"/>
					<h:selectOneRadio value="#{item.selectedOption}" layout="lineDirection" >
									<f:selectItems value="#{item.availableOptions}" escape="false"/>
									<f:validator validatorId="RequiredFieldsValidator" />
					</h:selectOneRadio>
				</h:panelGroup>
			</t:column>	
	</h:dataTable>
	
	<!-- Questions answers in each row view -->
  <t:dataTable id="sections" var="sectionItm" 
    value="#{reviewTest.currentAnswerItems}" rows="25" sortColumn="#{reviewTest.sortColumn}"
    sortAscending="#{reviewTest.ascending}" 
	  styleClass="mainTable"
    headerClass="standardTable_Header" 
    columnClasses=",horizontal_options"
	  rowClasses="rowA, rowB"
    rendered="#{reviewTest.table}">
    <t:column>
        <f:facet name="header">
            <t:commandSortHeader columnName="Questions" arrow="true">
                <h:outputText value="Questions" />
            </t:commandSortHeader>
        </f:facet>
	<!--h:outputText value="table (2)" /-->
        <h:outputText  value="#{sectionItm.description}" escape="false"/>
    </t:column>

    <t:column>
        <f:facet name="header">
            <t:commandSortHeader columnName="Answers Options" arrow="true">
                <h:outputText value="Answers Options"/>
            </t:commandSortHeader>
        </f:facet>
        <h:selectOneRadio value="#{sectionItm.selectedOption}" style="border:none" disabled="true">
		<f:selectItems value="#{sectionItm.availableOptions}" itemLabelEscaped="false"/>
	</h:selectOneRadio>
    </t:column>
   </t:dataTable>
    <h:panelGroup>
    	<h:commandButton value="Previous" id="prevBtn" action="#{reviewTest.prev}" styleClass="button_small"  partialSubmit="true" rendered="#{reviewTest.previous}"/>
    	<h:commandButton value="Show Result" action="#{reviewTest.showResult}" styleClass="button_small" partialSubmit="true" >
	    	<f:param name="testInstanceObjectId" value="#{testInstance.objectId}"/>
	        <f:param name="reviewMode" value="result1"/>
	    </h:commandButton>
	<h:commandButton value="Done" action="#{reviewTest.done}" styleClass="button_small"  partialSubmit="true"/>
        <h:commandButton value="Next" id="nextBtn" action="#{reviewTest.next}" styleClass="button_small"  partialSubmit="true" rendered="#{reviewTest.next}"/>
    </h:panelGroup>
  </h:panelGrid>
</h:form>
</div>
</f:view>
</html>
